package com.uniview.entity.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * 服务工单
 * 
 * @author Qingtian Lei
 * @Date 2018-05-28 23:17
 */
@Entity
@Table(name = "sd_orders")
public class ServiceOrders implements Serializable {

	private static final long serialVersionUID = -2758875634901586130L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "order_sequence")
	@SequenceGenerator(name = "order_sequence", sequenceName = "order_sequence", allocationSize = 1, initialValue = 1)
	private Integer id;

	private String orderNo; // 工单编号

	private String orderFrom; // 订单来源类型，可以多选 项目交付、对外测试、备件维修、网上问题、培训、其它

	private String orderFromNo; // 类型编号

	private String orderFromName; // 类型名称，项目名称、测试名称、备件名称

	private String onlineProblemsName; // 网上问题名称

	private String onlineOrderFromNo; // 网上问题来源单号

	private String customerName; // 客户名称

	private Date planTime; // 计划时间

	private String contactName; // 联系人名称

	private String customerAddress; // 客户地址
	
	private String customerLocation; // 客户地址坐标

	private String customerPhone; // 客户联系电话

	private String taskDesc; // 任务描述

	private String creator; // 工单创建人

	private String creatorNo; // 工单创建工号

	private String creatorDept; // 工单创建人部门

	private String creatorJobTitle; // 工单创建人职位

	private String creatorAvatar; // 创建人头像

	private String handle; // 工单当前处理人

	private String handleNo; // 工单当前处理人工号

	private String handlerDept; // 工单当前处理人部门

	private String handlerAvatar; // 当前处理人头像

	private String initDept; // 初始化选择的部门

	private String initWorkNo; // 初始化选择的工号

	private String initUserName;// 初始化选择的人员姓名

	private String managerNo; // 工单所属的服务经理工号

	private String status; // 工单状态 // 0 待审批 1 待处理 2 处理中 3 驳回 4 结束 5 关闭 6 草稿 7驳回更新

	@Transient
	private List<ServiceOrderMedia> medias; // 媒体类

	@Transient
	private List<ServiceOrderWarn> warns; // 警告消息

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime; // 工单开始时间

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime; // 工单结束时间

	private float workHours;// 工单总工时(小时)

	private String handleDesc; // 处理描述

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime; // 工单创建时间

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date modifyTime; // 工单更新时间

	private Integer isUrgent; // 是否紧急重要

	private int satisfaction; // 0 满意 1 不满意 2 未回复

	private String satisfactionDesc; // 满意度描述

	private Integer isWarning; // 是否警告 0 否 ,1 是

	private Integer parentId; // 父工单id

	private Integer dealStatus; //处理状态
	
	@Transient
	private List<ServiceOrdersLogs> logs = new ArrayList<>();// 日志
	
	@Transient
	private List<OrderCCRelation> orderCCRelations = new ArrayList<>();// 抄送对象

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getOrderFrom() {
		return orderFrom;
	}

	public void setOrderFrom(String orderFrom) {
		this.orderFrom = orderFrom;
	}

	public String getOrderFromNo() {
		return orderFromNo;
	}

	public void setOrderFromNo(String orderFromNo) {
		this.orderFromNo = orderFromNo;
	}

	public String getOrderFromName() {
		return orderFromName;
	}

	public void setOrderFromName(String orderFromName) {
		this.orderFromName = orderFromName;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public Date getPlanTime() {
		return planTime;
	}

	public void setPlanTime(Date planTime) {
		this.planTime = planTime;
	}

	public String getCustomerAddress() {
		return customerAddress;
	}

	public void setCustomerAddress(String customerAddress) {
		this.customerAddress = customerAddress;
	}

	public String getCustomerPhone() {
		return customerPhone;
	}

	public void setCustomerPhone(String customerPhone) {
		this.customerPhone = customerPhone;
	}

	public String getTaskDesc() {
		return taskDesc;
	}

	@Column(name = "taskDesc", columnDefinition = "CLOB", nullable = true)
	public void setTaskDesc(String taskDesc) {
		this.taskDesc = taskDesc;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public float getWorkHours() {
		return workHours;
	}

	public void setWorkHours(float workHours) {
		this.workHours = workHours;
	}

	public String getHandleDesc() {
		return handleDesc;
	}

	public void setHandleDesc(String handleDesc) {
		this.handleDesc = handleDesc;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public Integer getIsUrgent() {
		return isUrgent;
	}

	public void setIsUrgent(Integer isUrgent) {
		this.isUrgent = isUrgent;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public int getSatisfaction() {
		return satisfaction;
	}

	public void setSatisfaction(int satisfaction) {
		this.satisfaction = satisfaction;
	}

	public String getSatisfactionDesc() {
		return satisfactionDesc;
	}

	public void setSatisfactionDesc(String satisfactionDesc) {
		this.satisfactionDesc = satisfactionDesc;
	}

	public String getCreatorNo() {
		return creatorNo;
	}

	public void setCreatorNo(String creatorNo) {
		this.creatorNo = creatorNo;
	}

	public String getCreatorDept() {
		return creatorDept;
	}

	public void setCreatorDept(String creatorDept) {
		this.creatorDept = creatorDept;
	}

	public String getHandlerDept() {
		return handlerDept;
	}

	public void setHandlerDept(String handlerDept) {
		this.handlerDept = handlerDept;
	}

	public String getHandle() {
		return handle;
	}

	public void setHandle(String handle) {
		this.handle = handle;
	}

	public String getHandleNo() {
		return handleNo;
	}

	public void setHandleNo(String handleNo) {
		this.handleNo = handleNo;
	}

	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	public List<ServiceOrdersLogs> getLogs() {
		return logs;
	}

	public void setLogs(List<ServiceOrdersLogs> logs) {
		this.logs = logs;
	}

	public Integer getIsWarning() {
		return isWarning;
	}

	public void setIsWarning(Integer isWarning) {
		this.isWarning = isWarning;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public List<ServiceOrderMedia> getMedias() {
		return medias;
	}

	public void setMedias(List<ServiceOrderMedia> medias) {
		this.medias = medias;
	}

	public List<ServiceOrderWarn> getWarns() {
		return warns;
	}

	public void setWarns(List<ServiceOrderWarn> warns) {
		this.warns = warns;
	}

	public String getCreatorAvatar() {
		return creatorAvatar;
	}

	public void setCreatorAvatar(String creatorAvatar) {
		this.creatorAvatar = creatorAvatar;
	}

	public String getHandlerAvatar() {
		return handlerAvatar;
	}

	public void setHandlerAvatar(String handlerAvatar) {
		this.handlerAvatar = handlerAvatar;
	}

	public String getCreatorJobTitle() {
		return creatorJobTitle;
	}

	public void setCreatorJobTitle(String creatorJobTitle) {
		this.creatorJobTitle = creatorJobTitle;
	}

	public String getInitDept() {
		return initDept;
	}

	public void setInitDept(String initDept) {
		this.initDept = initDept;
	}

	public String getInitWorkNo() {
		return initWorkNo;
	}

	public void setInitWorkNo(String initWorkNo) {
		this.initWorkNo = initWorkNo;
	}

	public String getInitUserName() {
		return initUserName;
	}

	public void setInitUserName(String initUserName) {
		this.initUserName = initUserName;
	}

	public String getManagerNo() {
		return managerNo;
	}

	public void setManagerNo(String managerNo) {
		this.managerNo = managerNo;
	}

	public String getOnlineProblemsName() {
		return onlineProblemsName;
	}

	public void setOnlineProblemsName(String onlineProblemsName) {
		this.onlineProblemsName = onlineProblemsName;
	}

	public String getOnlineOrderFromNo() {
		return onlineOrderFromNo;
	}

	public void setOnlineOrderFromNo(String onlineOrderFromNo) {
		this.onlineOrderFromNo = onlineOrderFromNo;
	}

	public String getCustomerLocation() {
		return customerLocation;
	}

	public void setCustomerLocation(String customerLocation) {
		this.customerLocation = customerLocation;
	}

	public List<OrderCCRelation> getOrderCCRelations() {
		return orderCCRelations;
	}

	public void setOrderCCRelations(List<OrderCCRelation> orderCCRelations) {
		this.orderCCRelations = orderCCRelations;
	}

	public Integer getDealStatus() {
		return dealStatus;
	}

	public void setDealStatus(Integer dealStatus) {
		this.dealStatus = dealStatus;
	}
	
}
